﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterNhanSuTienLuong.Master" Inherits="System.Web.Mvc.ViewPage<DTTB.MV2.QUANLYNHANSUTIENLUONG.Models.FormBean.PhanQuyen.JobTitlesForm>" %>

<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<%@ Import Namespace="DTTB.DTO" %>
<%@ Import Namespace="System.Web.Mvc.Html" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/JobTitles/JobTitles.js") %>"></script>

    
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            selectMenu("HeThong-JobTitles");
            $("#HeThong-JobTitles").parent().attr("class", "active");            
            $("#GiaTriSearch").focus();
        });
       
    </script>


    <form id="form" method="POST" action="#" class="formBox">

    <%=Html.Hidden("JobTitleID")%>
    <%=Html.Hidden("PageNumber", Model.PageNumber)%>
    <div class="box">
        <div class="breadcrumbs">
          <ul>
            <li class="home"><a href="">Quản lý hệ thống</a></li>
            <li><a href="">Quản lý chức vụ</a></li>
            <li>Page</li>
          </ul>
        </div>
           <div class="headlines">
            <h2>
                <span>Quản lý chức vụ</span>
            </h2>
               <%-- <a class="show-filter" href="#">show filter</a>--%>
        </div>
		
        <table class="table_outsite" width="100%">
            <tr>
                <td>
                    <%--Thông Báo--%>
                    <%
                        if (Model.MessageCreateJobTitles != null)
                        {
                    %>
                    <div id="MessageCreateJobTitles" style="font-size: 12px; color: Blue; font-weight: bold">
                        <%=Model.MessageCreateJobTitles %></div>
                    <%
                        }
                    %>
                    <%
                        if (Model.MessageEditJobTitles != null)
                        {
                    %>
                    <div id="MessageEditJobTitles" style="font-size: 12px; color: Blue; font-weight: bold">
                        <%=Model.MessageEditJobTitles %></div>
                    <%
                        }
                    %>
                    <%--end--%>
                </td>
                <td align="right" class="btn-submit">
                    <input type="button" class="button" value="Tạo/Cập nhật " onclick="DoCreateOrEdit()" />
                    <input type="button" class="button"value="Tạo mới" onclick="javascript:DoNewAjax();" />
                    <input type="button" class="button" value="Xóa" onclick="javascript:DoDelete();" />
                    <input type="button" class="button" value="Nhập lại" onclick="javascript:DoReset();" />
                </td>
            </tr>
        </table >
        <table class="table_input" width="100%">
            <tr>
                <td nowrap="nowrap">
                    <%--Mã chức vụ :--%>
                </td>
                <td colspan="3">
                    <%--<input type="text" name="IdJob" id="IdJob" readonly="readonly" value='<%=Model.ID %>'/>--%>
                    <input type="hidden" name="IdJob" id="IdJob" value='<%=Model.ID %>'/>
                </td>
            </tr>
            

            <tr>
                <td style="width: 8%" nowrap="nowrap">
                    <b>Chức vụ:</b>
                </td>
                <td style="width: 55%">
                    <input  type="text" style="width: 80%" value="<%=Model.JobTitle%>" id="JobTitle" name="JobTitle" />
                    <div id="JobTitleMessage" class="red"></div>
                </td>
                <td style="width: 15%" nowrap="nowrap">
                    Ngày tạo:
                </td>
                <td style="width: 22%" nowrap="nowrap">
                    <input type="text" name="CreateDate" id="CreateDate" disabled="disabled"  value="<%=Model.CreateDate.ToShortDateString()%>" />
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap">
                    Mô tả:
                </td>
                <td>
                    <input type="text" style="width: 80%"  id="Description" name="Description" value="<%=Model.Description%>"/>                            
                </td>
                <td nowrap="nowrap">
                    Ngày cập nhật:
                </td>
                <td>
                    <input type="text" id="UpdateDate" disabled="disabled" value='<%=Model.UpdateDate.ToShortDateString()%>' />                                                               
                </td>
            </tr>

            <tr>
                <td colspan="2"></td>
                <td nowrap="nowrap">
                    Người tạo:
                </td>
                <td>
                    <input type="text"  name="CreateBy" id="CreateBy" disabled="disabled" value="<%=Model.CreateByUser%>" />
                </td>
            </tr>
            <tr>
                <td colspan="2"></td>
                 <td nowrap="nowrap">
                    Người cập nhật:
                </td>
                <td>
                    <input type="text"  id="UpdateBy" disabled="disabled" value='<%=Model.UpdateByUser%>' /> 
                </td>
            </tr>
            <tr>
                <td colspan="4">&nbsp;</td>
            </tr>
            <%--<tr>
                <td colspan="4" align="right">
                    <input type="button" value="Tạo/Cập nhật" onclick="DoCreateOrEdit()" />
                    <input type="button" value="Tạo mới" onclick="javascript:DoNewAjax();" />
                    <input type="button" value="Xóa" onclick="javascript:DoDelete();" />
                    <input type="button" value="Nhập lại" onclick="javascript:DoReset();" />
                </td>
            </tr>--%>
        </table>
		<div class="pagebreak"> &nbsp;</div>
        <table class="table_outsite" width="100%">
            <tr>
                <td colspan="2" class="first">
                    &nbsp;<b>Danh sách Chức vụ:</b>
                </td>
                <td colspan="2" class="first" align="right">
                    <%=Html.DropDownList("TieuChiSearch", Model.TieuChiSearchDropDownList)%>
                        <%=Html.TextBox("GiaTriSearch", Model.GiaTriSearch, new { @onkeypress = "if (event.keyCode==13) { return DoSearch(); }", Style = "width:210px" })%>
                        <img onclick="javascript:DoSearch();" style="vertical-align: middle; cursor:pointer" src="<%=ResolveUrl("~/Content/ImagesAdmin/search_icon.gif")%>"
                            alt="Tìm chức vụ" title="Tìm chức vụ"/>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <table cellspacing="0" cellpadding="0" class="tab tab-drag">
                        <tr class="top nodrop nodrag" style="font-weight: bold">
                            <td class="first" width="8%" style="text-align:center">
                                <strong>STT</strong>&nbsp;
                            </td>
                            <td nowrap="nowrap">
                                <strong>Chức Vụ</strong>
                            </td>
                            <td align="left" nowrap="nowrap">
                                <strong>Mô Tả</strong>
                            </td>
                            <td width="13%" nowrap="nowrap">
                                <strong>Ngày Cập Nhật</strong>
                            </td>
                            <td class="last" nowrap="nowrap">
                                <strong>Người Cập Nhật</strong>
                            </td>
                        </tr>
                        <%--JobTitles List--%>

                        <%
                                
                        IList<JobTitlesDto> JobTitlesDtoList = Model.JobTitlesPagedList;
                        int dem = 0;
                        foreach (JobTitlesDto dto in JobTitlesDtoList)
                        {
                        %>
                        <tr class="item_row" onclick="javascript:highlight(this);EditJobTitlesAjax(<%=dto.ID%>);">
                            <td class="first" style="text-align:center">
                                &nbsp;<%=++dem%>
                            </td>
                            <td align="left">
                                <%=dto.JobTitle%>&nbsp;
                            </td>
                            <td align="left">
                                <%=dto.Description %>
                            </td>
                            <td align="left">
                                <%=dto.UpdateDate.ToString("dd/MM/yyyy")%>&nbsp;
                            </td>
                            <td class="last">
                                <%=dto.UpdateByUser%>&nbsp;
                            </td>
                        </tr>
                        <%}
                        %>
                        <tr class="border_bottom">
                            <td class="first" style="background: #DDDDDD">
                            </td>
                            <td class="last" colspan="7" align="right" style="background: #DDDDDD; padding-right: 10px">
                                     
                                    <%
                                     
                                    PagerOptions pagerOptions = new PagerOptions();
                                    pagerOptions.PageIndexParameterName = "id";
                                    pagerOptions.NextPageText = "Tiếp";
                                    %>
                                <div><%=Html.Pager(Model.JobTitlesPagedList,pagerOptions) %></div>
                                    
                            </td>
                        </tr>
                        <%--dã xóa--%>
                    </table>
                </td>
            </tr>
        </table>
       <%-- </div>--%>
    </div>
    <%--<%Html.EndForm(); %>--%>

    </form>

    <%--<input type="hidden" id="TenSearch" name="TenSearch" />--%>
</asp:Content>
